package ahuy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;

public class Mang_array {

	public static void main(String[] args) {
//		nhapdulieu();
		so_doi_xung();
	}
	private static void nhapdulieu(){
		String line;
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		System.out.println("nhap vao n: \n");
		try {
			line = read.readLine();
			int i = 0;
			int n= Integer.parseInt(line);
			int mang []= new int [n];
			while (i<n)
			{
				System.out.println("Nhap phan tu thu "+(i+1)+": ");
				line = read.readLine();
				mang [i]=Integer.parseInt(line);
				i++;
			}
			for(int j=0 ;j<n;j++){
				System.out.println("arr["+(j)+"] =:"+mang[j]);
			}
			
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		
	}
	private static void so_doi_xung(){
			 System.out.println("Kiem tra so doi xung:");
			 try {
			 BufferedReader read = new BufferedReader(new InputStreamReader(System.in));

			 String line;

			 System.out.println("Nhap so:");
			 line = read.readLine();

			 int n = Integer.parseInt( line ); 
			 int k;
			 k = n;
			 int m = 0;

			 while(k > 0)
			 {
			 m = 10*m + k%10; //Lay so cuoi cung cua k dua vao m
			 k = k/10; // bo so cuoi cung cua k 
			 }
			 if(n == m)
			 System.out.println(n+ " la so doi xung ");
			 else
			 System.out.println (n +" khong la so doi xung ");

			 read.close();

			 } catch (Exception e) {
			 // TODO: handle exception
			 System.out.println(e);
			 }
			 }
	}
